package com.actions;
import javax.servlet.http.*;
import javax.swing.JOptionPane;

import java.util.*;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import com.beans.*;
import com.DAO.*;
public class DeleteUserAction extends org.apache.struts.action.Action{

	private final static String SUCCESS = "success";
    
    
    public ActionForward execute(ActionMapping mapping, ActionForm form,
            HttpServletRequest request, HttpServletResponse response)
            throws Exception {
    	
    	String id=request.getParameter("id");
    	UserDAO userDao=new UserDAO();
    	int rowsAffected=userDao.delete(id);
     	userDao.closeConnection();
    	return mapping.findForward(SUCCESS);
		
	} 
}